home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 4.2 KB | 127 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Frame.h
- // Release Version: $ ODF 2 $
- //
- // Author: Henri Lamiraux
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef BMPFRAME_H
- #define BMPFRAME_H
-
- #ifndef DEFINES_K
- #include "Defines.k"
- #endif
-
- // ----- Framework Includes -----
-
- #ifndef FWFRAME_H
- #include "FWFrame.h"
- #endif
-
- #ifndef FWFDRGDRP_H
- #include "FWDrgDrp.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CGrowBox;
- class CBitmapPart;
- class CBitmapSelection;
- class CBitmapContent;
-
- //========================================================================================
- // class CBitmapFrame
- //========================================================================================
-
- class CBitmapFrame : public FW_CFrame, public FW_MDraggableFrame, public FW_MDroppableFrame
- {
- //----------------------------------------------------------------------------------------
- // Initialization/Destruction
- //
- public:
- FW_DECLARE_AUTO(CBitmapFrame)
-
- CBitmapFrame(Environment* ev,
- ODFrame* odFrame,
- FW_CPresentation* presentation,
- CBitmapPart* bitmapPart,
- CBitmapContent* bitmapContent);
- virtual ~ CBitmapFrame();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual FW_Handled DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
- virtual FW_Handled DoAdjustMenus(Environment* ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot);
-
- virtual void FocusStateChanged(Environment* ev, ODTypeToken focus, FW_Boolean newState, ODFrame* newOwner);
- #if FW_SUPPORTS_CYBERDOG
- virtual FW_Handled HandleWindowEvent (Environment* ev, const FW_CMacWindowEvent& windowEvent);
- #endif
- virtual void FrameShapeChanged(Environment* ev);
-
- virtual ODShape* AdjustUsedShape(Environment* ev, ODShape* suggestedUsedShape);
- virtual ODShape* AdjustActiveShape(Environment* ev, ODFacet* facet, ODShape* suggestedActiveShape);
-
- virtual void AdjustZoomedWindowSize(Environment *ev, FW_CPoint& proposedSize);
-
- virtual void Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);
- virtual void BuildThumbnail(Environment* ev, FW_CGraphicContext& gc, FW_CRect& usedRect);
-
- virtual FW_Handled DoMouseDown(Environment* ev, const FW_CMouseEvent& theMouseEvent);
-
- virtual FW_Handled DoIdle(Environment* ev, const FW_CNullEvent& theNullEvent);
-
- virtual void CreateSubViews(Environment* ev);
-
- // ----- Commands -----
- virtual FW_CClipboardCommand* NewClipboardCommand(Environment* ev, ODCommandID commandID);
-
- virtual FW_CDropCommand* NewDropCommand(Environment *ev,
- FW_CFrame* frame,
- ODDragItemIterator* dropInfo,
- ODFacet* facet,
- const FW_CPoint& dropPoint);
-
- virtual FW_CDragCommand* NewDragCommand(Environment *ev,
- FW_CFrame* theFrame,
- const FW_CMouseEvent& theMouseEvent);
-
- // ----- External/Internalize -----
- virtual void ExternalizeFrame(Environment* ev, ODStorageUnitView* storageUnitView);
- virtual void InternalizeFrame(Environment* ev, ODStorageUnitView* storageUnitView);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- FW_CPoint GetZoomRatio(Environment* ev) const;
- void AdjustFrameSize(Environment* ev);
-
- void CalcUsedRect(Environment* ev, FW_CRect& newUsedRect) const;
-
- ODCommandID GetChosenSize() const
- {return fChosenSize;}
-
- void SetContainingPartColor(Environment* ev, const FW_CPoint& mousePoint) const;
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- CBitmapContent* fBitmapContent; // Pointer to my content
- ODCommandID fChosenSize; // Chosen Size (50%, 100%, 200%, or fit to frame)
- FW_CRect fFrameRect; // The lastest frame shape rect
- CBitmapSelection* fSelection;
- FW_CIdler* fIdler;
- };
-
- #endif
-